home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Mesa-2.2 / include / glaux.h next >
Encoding:
C/C++ Source or Header  |  1997-02-03  |  7.8 KB  |  343 lines

  1. /* $Id: glaux.h,v 1.3 1997/02/03 20:08:13 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa - a 3-D graphics library
  5.  * Version:  2.1
  6.  * Copyright (C) 1995-1996  Brian Paul
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * This code originated from SGI and was modified for use with Mesa.
  26.  */
  27.  
  28.  
  29. #ifndef AUX_INCLUDED
  30. #define AUX_INCLUDED
  31.  
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37.  
  38. #if !defined(AMIGA) && !defined(__WIN32__) && !defined(NeXT) && !defined(__QUICKDRAW__) && !defined(DOSVGA) && !defined(__BEOS__)
  39. #  include <X11/Xlib.h>
  40. #  include <X11/Xutil.h>
  41. #endif
  42. #ifdef __BEOS__
  43. #include "GL/gl.h"
  44. #include "GL/glu.h"
  45. #else
  46. #include <GL/gl.h>
  47. #include <GL/glu.h>
  48. #endif
  49.  
  50. /*
  51. ** ToolKit Window Types
  52. ** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
  53. */
  54.  
  55. #define AUX_RGB        0
  56. #define AUX_RGBA    AUX_RGB
  57. #define AUX_INDEX    1
  58. #define AUX_SINGLE    0
  59. #define AUX_DOUBLE    2
  60. #define AUX_DIRECT    0
  61. #define AUX_INDIRECT    4
  62.  
  63. #define AUX_ACCUM    8
  64. #define AUX_ALPHA    16
  65. #define AUX_DEPTH    32
  66. #define AUX_STENCIL    64
  67. #define AUX_AUX        128
  68.  
  69. /* 
  70. ** Window Masks
  71. */
  72.  
  73. #define AUX_WIND_IS_RGB(x)    (((x) & AUX_INDEX) == 0)
  74. #define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
  75. #define AUX_WIND_IS_SINGLE(x)    (((x) & AUX_DOUBLE) == 0)
  76. #define AUX_WIND_IS_DOUBLE(x)    (((x) & AUX_DOUBLE) != 0)
  77. #define AUX_WIND_IS_INDIRECT(x)    (((x) & AUX_INDIRECT) != 0)
  78. #define AUX_WIND_IS_DIRECT(x)    (((x) & AUX_INDIRECT) == 0)
  79. #define AUX_WIND_HAS_ACCUM(x)    (((x) & AUX_ACCUM) != 0)
  80. #define AUX_WIND_HAS_ALPHA(x)    (((x) & AUX_ALPHA) != 0)
  81. #define AUX_WIND_HAS_DEPTH(x)    (((x) & AUX_DEPTH) != 0)
  82. #define AUX_WIND_HAS_STENCIL(x)    (((x) & AUX_STENCIL) != 0)
  83.  
  84. /*
  85. ** Display Mode Selection Criteria
  86. */
  87.  
  88. enum {
  89.     AUX_USE_ID = 1,
  90.     AUX_EXACT_MATCH,
  91.     AUX_MINIMUM_CRITERIA
  92. };
  93.  
  94.  
  95. #define AUX_OFF 0
  96. #define AUX_ON 1
  97.  
  98.  
  99. /*
  100. ** ToolKit Event Structure
  101. */
  102.  
  103. typedef struct _AUX_EVENTREC {
  104.     GLint event;
  105.     GLint data[4];
  106. } AUX_EVENTREC;
  107.  
  108. /* 
  109. ** ToolKit Event Types
  110. */
  111. #define AUX_EXPOSE    1
  112. #define AUX_CONFIG    2
  113. #define AUX_DRAW    4
  114. #define AUX_KEYEVENT    8
  115. #define AUX_MOUSEDOWN    16
  116. #define AUX_MOUSEUP    32    
  117. #define AUX_MOUSELOC    64
  118.  
  119. /*
  120. ** Toolkit Event Data Indices
  121. */
  122. #define AUX_WINDOWX        0
  123. #define AUX_WINDOWY        1
  124. #define AUX_MOUSEX        0
  125. #define AUX_MOUSEY        1
  126. #define AUX_MOUSESTATUS        3
  127. #define AUX_KEY            0
  128. #define AUX_KEYSTATUS        1
  129.  
  130. /*
  131. ** ToolKit Event Status Messages
  132. */
  133. #define    AUX_LEFTBUTTON        1
  134. #define    AUX_RIGHTBUTTON        2
  135. #define    AUX_MIDDLEBUTTON    4
  136. #define    AUX_SHIFT        1
  137. #define    AUX_CONTROL        2
  138.  
  139. /* 
  140. ** ToolKit Key Codes
  141. */
  142. #define AUX_RETURN        0x0D
  143. #define AUX_ESCAPE        0x1B
  144. #define AUX_SPACE        0x20
  145. #define AUX_LEFT        0x25
  146. #define AUX_UP            0x26
  147. #define AUX_RIGHT        0x27
  148. #define AUX_DOWN        0x28
  149. #define AUX_A            'A'
  150. #define AUX_B            'B'
  151. #define AUX_C            'C'
  152. #define AUX_D            'D'
  153. #define AUX_E            'E'
  154. #define AUX_F            'F'
  155. #define AUX_G            'G'
  156. #define AUX_H            'H'
  157. #define AUX_I            'I'
  158. #define AUX_J            'J'
  159. #define AUX_K            'K'
  160. #define AUX_L            'L'
  161. #define AUX_M            'M'
  162. #define AUX_N            'N'
  163. #define AUX_O            'O'
  164. #define AUX_P            'P'
  165. #define AUX_Q            'Q'
  166. #define AUX_R            'R'
  167. #define AUX_S            'S'
  168. #define AUX_T            'T'
  169. #define AUX_U            'U'
  170. #define AUX_V            'V'
  171. #define AUX_W            'W'
  172. #define AUX_X            'X'
  173. #define AUX_Y            'Y'
  174. #define AUX_Z            'Z'
  175. #define AUX_a            'a'
  176. #define AUX_b            'b'
  177. #define AUX_c            'c'
  178. #define AUX_d            'd'
  179. #define AUX_e            'e'
  180. #define AUX_f            'f'
  181. #define AUX_g            'g'
  182. #define AUX_h            'h'
  183. #define AUX_i            'i'
  184. #define AUX_j            'j'
  185. #define AUX_k            'k'
  186. #define AUX_l            'l'
  187. #define AUX_m            'm'
  188. #define AUX_n            'n'
  189. #define AUX_o            'o'
  190. #define AUX_p            'p'
  191. #define AUX_q            'q'
  192. #define AUX_r            'r'
  193. #define AUX_s            's'
  194. #define AUX_t            't'
  195. #define AUX_u            'u'
  196. #define AUX_v            'v'
  197. #define AUX_w            'w'
  198. #define AUX_x            'x'
  199. #define AUX_y            'y'
  200. #define AUX_z            'z'
  201. #define AUX_0            '0'
  202. #define AUX_1            '1'
  203. #define AUX_2            '2'
  204. #define AUX_3            '3'
  205. #define AUX_4            '4'
  206. #define AUX_5            '5'
  207. #define AUX_6            '6'
  208. #define AUX_7            '7'
  209. #define AUX_8            '8'
  210. #define AUX_9            '9'
  211.  
  212. /*
  213. ** ToolKit Gets and Sets
  214. */
  215. #define AUX_FD            1  /* return fd (long) */
  216. #define AUX_COLORMAP        3  /* pass buf of r, g and b (unsigned char) */
  217. #define AUX_GREYSCALEMAP    4
  218. #define AUX_FOGMAP        5  /* pass fog and color bits (long) */
  219. #define AUX_ONECOLOR        6  /* pass index, r, g, and b (long) */
  220.  
  221. /*
  222. ** Color Macros
  223. */
  224.  
  225. enum {
  226.     AUX_BLACK = 0,
  227. #ifdef __WIN32__
  228.     AUX_RED=10,
  229. #else
  230.     AUX_RED,
  231. #endif
  232.     AUX_GREEN,
  233.     AUX_YELLOW,
  234.     AUX_BLUE,
  235.     AUX_MAGENTA,
  236.     AUX_CYAN,
  237.     AUX_WHITE
  238. };
  239.  
  240. #if defined(__WIN32__) || defined(DOSVGA)
  241.    extern float auxRGBMap[17][3];
  242. #else
  243.    extern float auxRGBMap[8][3];
  244. #endif
  245.  
  246. #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
  247.                    glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
  248.  
  249. /*
  250. ** RGB Image Structure
  251. */
  252.  
  253. typedef struct _AUX_RGBImageRec {
  254.     GLint sizeX, sizeY;
  255.     unsigned char *data;
  256. } AUX_RGBImageRec;
  257.  
  258. /*
  259. ** Prototypes
  260. */
  261.  
  262. #ifdef __BEOS__
  263. #pragma export on
  264. #endif
  265.  
  266. extern void auxInitDisplayMode(GLbitfield);
  267. extern void auxInitPosition(int, int, int, int);
  268. extern GLenum auxInitWindow(char *);
  269. extern void auxCloseWindow(void);
  270. extern void auxQuit(void);
  271. extern void auxSwapBuffers(void);
  272.  
  273. #if !defined(AMIGA) && !defined(__WIN32__) && !defined(NeXT) && !defined(__QUICKDRAW__) && !defined(DOSVGA) && !defined(__BEOS__)
  274. extern Display *auxXDisplay(void);
  275. extern Window auxXWindow(void);
  276. #endif
  277.  
  278. extern void auxMainLoop(void (*)());
  279. extern void auxExposeFunc(void (*)(int, int));
  280. extern void auxReshapeFunc(void (*)(int, int));
  281. extern void auxIdleFunc(void (*)());
  282. extern void auxKeyFunc(int, void (*)());
  283. extern void auxMouseFunc(int, int, void (*)(AUX_EVENTREC *));
  284.  
  285. extern void auxDeleteMouseFunc( int, int , void (*)(AUX_EVENTREC *));
  286.  
  287. extern int auxGetColorMapSize(void);
  288. extern void auxGetMouseLoc(int *, int *);
  289. extern void auxSetOneColor(int, float, float, float);
  290. extern void auxSetFogRamp(int, int);
  291. extern void auxSetGreyRamp(void);
  292. extern void auxSetRGBMap(int, float *);
  293.  
  294. extern AUX_RGBImageRec *auxRGBImageLoad(char *);
  295.  
  296. extern void auxCreateFont(void);
  297. extern void auxDrawStr(char *);
  298.  
  299. extern void auxWireSphere(GLdouble);
  300. extern void auxSolidSphere(GLdouble);
  301. extern void auxWireCube(GLdouble);
  302. extern void auxSolidCube(GLdouble);
  303. extern void auxWireBox(GLdouble, GLdouble, GLdouble);
  304. extern void auxSolidBox(GLdouble, GLdouble, GLdouble);
  305. extern void auxWireTorus(GLdouble, GLdouble);
  306. extern void auxSolidTorus(GLdouble, GLdouble);
  307. extern void auxWireCylinder(GLdouble, GLdouble);
  308. extern void auxSolidCylinder(GLdouble, GLdouble);
  309. extern void auxWireIcosahedron(GLdouble);
  310. extern void auxSolidIcosahedron(GLdouble);
  311. extern void auxWireOctahedron(GLdouble);
  312. extern void auxSolidOctahedron(GLdouble);
  313. extern void auxWireTetrahedron(GLdouble);
  314. extern void auxSolidTetrahedron(GLdouble);
  315. extern void auxWireDodecahedron(GLdouble);
  316. extern void auxSolidDodecahedron(GLdouble);
  317. extern void auxWireCone(GLdouble, GLdouble);
  318. extern void auxSolidCone(GLdouble, GLdouble);
  319. extern void auxWireTeapot(GLdouble);
  320. extern void auxSolidTeapot(GLdouble);
  321.  
  322. /* added for viewperf benchmark */
  323. extern void auxInitDisplayModePolicy( GLenum type );
  324. extern GLenum auxGetDisplayModePolicy( void );
  325. extern GLenum auxInitDisplayModeID( GLint id );
  326. extern GLint auxGetDisplayModeID( void );
  327. extern GLenum auxGetDisplayMode( void );
  328.  
  329. extern void auxGetScreenSize( GLint *width, GLint *height );
  330.  
  331. extern void auxAnimation( GLint flag );
  332.  
  333. #ifdef __BEOS__
  334. #pragma export off
  335. #endif
  336.  
  337. #ifdef __cplusplus
  338. }
  339. #endif
  340.  
  341.  
  342. #endif /* AUX_INCLUDED */
  343.